package com.itheima.mapper;


import com.itheima.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    List<Role> queryAll();

    void addRoleIdAndPermissionId(@Param("permissionIds") Integer[] permissionIds, @Param("id") Integer roleId);

    Integer[] queryPermissionIdsByRoleId(@Param("roleId") Integer roleId);

    void deletePermissionIdByRoleId(@Param("roleId") Integer roleId);

    void add(Role role);

    void setRoleAndMenu(@Param("menuIds") Integer[] menuIds,@Param("roleId") Integer roleId);

    void setRoleAndPermission(@Param("permissionIds")Integer[] permissionIds,@Param("roleId") Integer roleId);

    List<Role> findByCondition(@Param("queryString")String queryString);

    Role findById(@Param("id")Integer id);

    List<Integer> findPermissionIdsById(@Param("id")Integer id);

    List<Integer> findMenuIdsById(@Param("id")Integer id);

    void deleteAssociation(@Param("id")Integer roleId);

    void deleteAssociation2(@Param("id")Integer roleId);

    void edit(Role role);


    Integer findCountById(@Param("id")Integer id);

    void deleteRoleById(@Param("id")Integer id);

    List<String> findPathsByMenuIds(@Param("menuIds")Integer[] menuIds);

    Integer findMenuIdByPath(@Param("s2")String s2);

    void setRoleAndMenu2(@Param("roleId")Integer roleId,@Param("menuId") Integer menuId);

    Integer findCountByMenuIdAndroleId(@Param("roleId")Integer roleId, @Param("menuId") Integer menuId);
}
